package com.sdx.console.answer.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.answer.dao.QaAnswerCommentDao;
import com.sdx.console.answer.entity.QaAnswerComment;
import com.ibeetl.admin.core.service.BaseService;

/**
 * 回答评论 Service
 */

@Service
@Transactional
public class QaAnswerCommentService extends BaseService<QaAnswerComment>{

    @Resource
	private QaAnswerCommentDao qaAnswerCommentDao;

    public PageQuery<QaAnswerComment>queryByCondition(PageQuery query){
        PageQuery ret =  qaAnswerCommentDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelQaAnswerComment(List<String> ids){
        try {
            qaAnswerCommentDao.batchDelQaAnswerCommentByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除回答评论失败", e);
        }
    }

	public List<QaAnswerComment> all() {
		return qaAnswerCommentDao.all();
		}
}